﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Thallo {
    public enum UpdateMode {
        None,
        Normal,
        Auto
    }

    class TypeDescriptor {
        public string Name { get; set; }

        public bool Disabled { get; set; }

        public RuntimeTypeHandle Handle { get; set; }

        public MethodDescriptor[] Methods { get; set; }
    }

    class MethodDescriptor {
        public MethodDescriptor() {

        }
        public MethodDescriptor(TypeDescriptor typeinfo) {
            this.TypeInfo = typeinfo;
        }

        public TypeDescriptor TypeInfo { get; set; }

        public string Name { get; set; }

        public System.Reflection.MethodInfo Method { get; set; }

        public UpdateMode UpdateMode { get; set; }

        public int ExpirationTime { get; set; }

        public IMethodHandler MethodHandler {
            get;
            set;
        }

        public string[] DependencyGroups { get; set; }

        public DependencyAttribute[] DependencyAttributes { get; set; }

    }

    class DependencyNode {
        public DependencyNode() {
            DependencyMethods = new HashSet<MethodInfo>();
        }

        public RuntimeTypeHandle TypeHandle { get; set; }

        public string MethodName { get; set; }

        public HashSet<System.Reflection.MethodInfo> DependencyMethods { get; private set; }
    }
}
